USE [dbdata]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_SumLog_DateTime]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[SumLog] DROP CONSTRAINT [DF_SumLog_DateTime]
END

GO

USE [dbdata]
GO

/****** Object:  Table [dbo].[SumLog]    Script Date: 03/15/2012 12:09:59 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SumLog]') AND type in (N'U'))
DROP TABLE [dbo].[SumLog]
GO

USE [dbdata]
GO

/****** Object:  Table [dbo].[SumLog]    Script Date: 03/15/2012 12:09:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SumLog](
	[ID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[DateTime] [datetime] NOT NULL,
	[Account_Id] [bigint] NOT NULL,
	[Phone] [varchar](20) NULL,
	[Categ_code] [varchar](12) NOT NULL,
	[SumOld] [money] NULL,
	[SumNew] [money] NULL,
 CONSTRAINT [PK_SumLog] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[SumLog] ADD  CONSTRAINT [DF_SumLog_DateTime]  DEFAULT (getdate()) FOR [DateTime]
GO

